package com.watson.onebox.aspect;

import com.watson.onebox.aspect.annotations.Login;
import com.watson.onebox.aspect.test.TestBean;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.core.DebuggingClassWriter;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Data
public class TestMethod {

    @Autowired
    TestBean testBean;

    int type;

    @Login(username = "abc-${env}", password = "b")
    public String getData() {

        String a = testBean.test();
        log.info("a:{}, {}", a, type);
        log.info("get data");
        return "getData";
    }
}
